home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #3 & #4
/
Amiga Plus CD - 1995 - No. 3 and 4.iso
/
pd
/
sonstiges
/
translator
/
docs
/
translator.autodoc
next >
Wrap
Text File
|
1995-07-20
|
4KB
|
130 lines
TABLE OF CONTENTS
translator.library/--background--
translator.library/Translate
translator.library/TranslateAs
translator.library/SetAccent
translator.library/LoadAccent
translator.library/--background-- translator.library/--background--
OVERVIEW
Version 42 of the translator library supports multi-lingual
text to phoneme translation. It maintains a list of loaded
accent files. The user can select the accent with the Translator
preferences program.
COMPATIBILITY
Great care has been taken to ensure the new library works in
all situations where the old one did. Because the new library
has more to do, it is more likely somthing will go wrong.
The old Translate() interface did not provide sufficient
room for expansion. In this version errors are reported
to the user by means of a requester. This includes reporting
syntax errors in the Accent files.
Functions in this library may be called from tasks even
if they might cause DOS I/O.
The library creates a new base for each call to OpenLibrary.
However the list of loaded accents is global to all library bases.
translator.library/Translate translator.library/Translate
NAME
Translate -- Convert an text string into narrator device phonemes.
SYNOPSIS
rtnCode = Translate(inString, inLength, outBuffer, outLength)
D0 A0 D0 A1 D1
LONG Translate( STRPTR inString, LONG inLength, STRPTR outBuffer,
LONG outlen );
FUNCTION
The translate function converts a text string into
a string of phonetic codes suitable as input to the
narrator device. The V42 version may need to call the DOS
library. If called by a task it will start a process to do
the I/O. The origional version allocated no external resources
including memory or other shared libraries. The new version
allocate memory and may call Exec and DOS functions. Thus
there is the possibility of these calls failing. However the
privious version was documented so:
The only error that can occur is overflowing the outBuffer.
For this reason no error code can be returned. If an error
occurs a message is displayed in a requester or to the console
and 0 is returned. The output buffer set to an empty string.
INPUTS
inString - pointer to English string
inLength - length of English string
outBuffer - a char array which will hold the phonetic codes
outLength - the length of the output array
RESULTS
rtnCode - zero if no error has occured.
The only error that can occur (as far as the calling process
need be concerned) is overflowing the outBuffer.
If Translate() determines that an overflow will occur, it
will stop the translation at a word boundary before the
overflow happens. If this occurs, rtnCode will be a
negative number whose absolute value indicates where in
inString Translate() stopped. The user can then use the
offset-rtnCode from the beginning of inString in a
subsequent Translate() call to continue the translation.
SEE ALSO
narrator.device/CMD_WRITE
translator.library/SetAccent translator.library/SetAccent
NAME
Translate -- Set the accent to be used with Translate(). (V42)
SYNOPSIS
rtnCode = SetAccent(STRPTR accent)
D0 A0
BOOL SetAccent(accent)
FUNCTION
Specify the default Accent file to be used by the Translate()
function. Either the pathname or just the accent name may be
specified. In the latter case LOCALE:Accents/ is searched.
This only affects the current instance of the OpenLibrary. To affect
further instances ENV:Sys/Translator.prefs needs to be changed.
INPUTS
accent - name or path of a accent file
RESULTS
Boolean success of failure.
translator.library/LoadAccent translator.library/LoadAccent
NAME
LoadAccent -- (Re)load an accent file into the cache. (V42)
SYNOPSIS
rtnCode = LoadAccent(accent)
D0 A0
BOOL LoadAccent(STRPTR accent)
FUNCTION
The narrator library maintains a cache of loaded accent files.
This cache is flushed on low memory situations. This function
loads (and possible replaces an existing entry) an accent file.
INPUTS
accent - name or path of a accent file
RESULTS
Boolean success of failure.